home *** CD-ROM | disk | FTP | other *** search
/ Games of Daze / Infomagic - Games of Daze (Summer 1995) (Disc 1 of 2).iso / x2ftp / msdos / docs / winer / chap8-6.bas < prev    next >
Encoding:
BASIC Source File  |  1992-05-13  |  324 b   |  19 lines

  1. '*********** CHAP8-6.BAS - illustrates floating point math rounding errors
  2.  
  3. 'Copyright (c) 1992 Ethan Winer
  4.  
  5. Value! = 1!
  6. Result! = 2!
  7. CLS
  8.  
  9. FOR X = 1 TO 1000
  10.   Value! = Value! + .001
  11. NEXT
  12.  
  13. IF Value! = Result! THEN
  14.   PRINT "They are equal"
  15. ELSE
  16.   PRINT "Value! ="; Value!
  17.   PRINT "Result! ="; Result!
  18. END IF
  19.